import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MemberReservationVO, MemberReservationForm, MemberReservationQuery } from '@/api/primary/memberReservation/types';

/**
 * 查询【请填写功能名称】列表
 * @param query
 * @returns {*}
 */

export const listMemberReservation = (query?: MemberReservationQuery): AxiosPromise<MemberReservationVO[]> => {
  return request({
    url: '/primary/memberReservation/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询【请填写功能名称】详细
 * @param memberId
 */
export const getMemberReservation = (memberId: string | number): AxiosPromise<MemberReservationVO> => {
  return request({
    url: '/primary/memberReservation/' + memberId,
    method: 'get'
  });
};

/**
 * 新增【请填写功能名称】
 * @param data
 */
export const addMemberReservation = (data: MemberReservationForm) => {
  return request({
    url: '/primary/memberReservation',
    method: 'post',
    data: data
  });
};

/**
 * 修改【请填写功能名称】
 * @param data
 */
export const updateMemberReservation = (data: MemberReservationForm) => {
  return request({
    url: '/primary/memberReservation',
    method: 'put',
    data: data
  });
};

/**
 * 删除【请填写功能名称】
 * @param memberId
 */
export const delMemberReservation = (memberId: string | number | Array<string | number>) => {
  return request({
    url: '/primary/memberReservation/' + memberId,
    method: 'delete'
  });
};
